dask delayed
Delayed Best Practices — Dask documentation
How to parallelize Python code with Dask Delayed (YouTube)
Dask Delayed — How to Parallelize Your Python Code With Ease | by Dario Radečić | Towards Data Science
With list comprehension
code:python
@delayed
def function():
....
compute(*list)
With Progress bar
code:python
from dask.distributed import progress,Client
from dask.diagnostics import ProgressBar
client=Client()
client
@delayed
def func(n):
...
results=[]
for n in range(100):
results.append(func(n))
futures = client.compute(results)
progress(futures)
code:python
Tips
When we used dask.delayed without having a distributed scheduler, we are relying on a single-machine scheduler, and dask will use the threadpool executor, which by default will use the resources available on your machine.
You can check this by doing:
code:python
import os
os.cpu_count()